<template>
  <div class="divda">
    <div>
      <div class="image">
        <van-image
          round
          width="30px"
          height="30px"
          :src="poot+'miaozishangchengFile/user/'+user+'/头像.jpg'"
        />
        <font>{{alias}} 时间:{{time}}</font> &nbsp;
        <van-rate class="fonttitle" size="10" readonly v-model="score" />
      </div>
      <div class="div">{{evaluate}}</div>
      <vue-preview
        v-if="list.length>0"
        class="vuepr"
        :list="list"
        :thumbImageStyle="{width: '80px', height: '80px', margin: '10px'}"
        :previewBoxStyle="{border: '1px solid #fff'}"
        :tapToClose="true"
      />
    </div>
  </div>
</template>
<script>
import { mapState, mapGetters, mapMutations, mapActions } from "vuex";

export default {
  props: ["time", "users", "score", "evaluate", "name"],
  data() {
    return {
      list: [],
      list2: {},

      value: 5,
      alias: ""
    };
  },
  methods: {
    chushihua() {
      this.$http
        .get(this.poot + "selectuser/" + this.users)
        .then(response => {
          console.log(response.data);
          this.alias = response.data.alias;
        })
        .catch(function(error) {
          console.log(error);
          alert("获取数据失败");
        });
    },
    img() {
      this.$http
        .get(
          this.poot +
            "selectimg/" +
            this.name +
            "/" +
            this.users +
            "/" +
            this.time
        )
        .then(response => {
          console.log(response.data);
          this.list = response.data;
          for (var i = 0; i < response.data.length; i++) {
            this.list[i].src = this.poot + response.data[i].src;
          }
        })
        .catch(function(error) {
          console.log(error);
          // alert("获取数据失败");
        });
    }
  },
  mounted() {
    this.chushihua();
    this.img();
  },
  computed: {
    ...mapState(["poot"]),
    ...mapState(["yx"]),
    ...mapState(["zhuantai"]),
    ...mapState(["user"])
  }
};
</script>
<style scoped>
.divda {
  margin-bottom: 10px;
  text-align: left;
}
.vuepr {
  height: 100px;
}
.div {
  margin-left: 5px;
  text-align: left;
  font-size: 10px;
}
.image {
  text-align: left;
  margin-left: 15px;
}
h3 {
  text-align: center;
  font-size: 5px;
}
font {
  font-size: 5px;
  text-align: center;
}
</style>